package com.youzi.tunnel.server.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.netty.channel.Channel;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;


@Data
@EqualsAndHashCode
public class Client implements Serializable {

    @TableId(value = "id")
    private String id;

    private String name;

    private String macAddress;

    @TableField(exist = false)
    private String host;

    @TableField(exist = false)
    private boolean online;

    @TableField(exist = false)
    private Channel channel;

    public Client() {
    }

    public Client(String id, String name, String macAddress, String host, Boolean online) {
        this.id = id;
        this.name = name;
        this.macAddress = macAddress;
        this.host = host;
        this.online = online;
    }

    public Client copy() {
        Client client = new Client();
        client.setId(id);
        client.setName(name);
        client.setHost(host);
        return client;
    }
}
